<template>
  <div id="analyze-page" class="main-content">
    <!-- 顶部导航栏 -->
    <el-header class="header-container">
      <div class="header-content">
        <div class="logo">
          <i class="el-icon-line-chart logo-icon"></i>
          <span class="logo-text">智慧农业分析平台</span>
        </div>
        <div class="header-tabs">
          <el-tabs v-model="activeTab" :tab-position="'top'" style="width: 100%;">
            <el-tab-pane label="服务资源分析" name="resourceAnalysis">
              <i class="el-icon-database"></i>
            </el-tab-pane>
            <el-tab-pane label="订单趋势统计" name="orderStatistics">
              <i class="el-icon-trend-charts"></i>
              <span>订单趋势统计</span>
            </el-tab-pane>
            <el-tab-pane label="资源分布地图" name="resourceMap">
              <i class="el-icon-map-location"></i>
              <span>资源分布地图</span>
            </el-tab-pane>
          </el-tabs>
        </div>
      </div>
    </el-header>

    <!-- 主内容区域 -->
    <el-main class="main-container">
      <!-- 统计卡片 -->
      <el-row :gutter="16" class="stats-cards">
        <el-col :xs="24" :sm="12" :lg="6" class="stat-card-wrapper">
          <div class="stat-card stat-card-primary">
            <div class="stat-icon">
              <i class="el-icon-service"></i>
            </div>
            <div class="stat-content">
              <div class="stat-title">总服务资源</div>
              <div class="stat-value">{{ totalResources.toLocaleString() }}</div>
              <div class="stat-change">
                <i class="el-icon-arrow-up"></i>
                <span>12.5% 较上月</span>
              </div>
            </div>
          </div>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="6" class="stat-card-wrapper">
          <div class="stat-card stat-card-success">
            <div class="stat-icon">
              <i class="el-icon-shopping-cart"></i>
            </div>
            <div class="stat-content">
              <div class="stat-title">本月订单</div>
              <div class="stat-value">{{ monthlyOrders.toLocaleString() }}</div>
              <div class="stat-change">
                <i class="el-icon-arrow-up"></i>
                <span>8.3% 较上月</span>
              </div>
            </div>
          </div>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="6" class="stat-card-wrapper">
          <div class="stat-card stat-card-warning">
            <div class="stat-icon">
              <i class="el-icon-coin"></i>
            </div>
            <div class="stat-content">
              <div class="stat-title">服务收入</div>
              <div class="stat-value">¥{{ serviceRevenue.toLocaleString() }}</div>
              <div class="stat-change">
                <i class="el-icon-arrow-up"></i>
                <span>15.2% 较上月</span>
              </div>
            </div>
          </div>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="6" class="stat-card-wrapper">
          <div class="stat-card stat-card-info">
            <div class="stat-icon">
              <i class="el-icon-user"></i>
            </div>
            <div class="stat-content">
              <div class="stat-title">活跃用户</div>
              <div class="stat-value">{{ activeUsers.toLocaleString() }}</div>
              <div class="stat-change">
                <i class="el-icon-arrow-up"></i>
                <span>5.7% 较上月</span>
              </div>
            </div>
          </div>
        </el-col>
      </el-row>

      <!-- 搜索和筛选区域 -->
      <el-card class="search-filter-card">
        <div class="search-filter">
          <el-input
            v-model="searchName"
            placeholder="请输入主体名称"
            class="search-input"
            prefix-icon="el-icon-search"
          />
          <el-select v-model="selectedCrop" placeholder="请选择作物" class="filter-select">
            <el-option label="全部" value="all" />
            <el-option label="水稻" value="rice" />
            <el-option label="小麦" value="wheat" />
            <el-option label="玉米" value="corn" />
            <el-option label="茶叶" value="tea" />
          </el-select>
          <el-select v-model="selectedType" placeholder="请选择服务类型" class="filter-select">
            <el-option label="全部" value="all" />
            <el-option label="翻犁" value="plow" />
            <el-option label="播种" value="sow" />
            <el-option label="施肥" value="fertilize" />
            <el-option label="植保" value="protection" />
            <el-option label="收获" value="harvest" />
            <el-option label="技术指导" value="guidance" />
          </el-select>
          <el-date-picker
            v-model="dateRange"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            class="date-range-picker"
          />
          <el-button type="primary" icon="el-icon-search" class="search-button">搜索</el-button>
          <el-button icon="el-icon-refresh" class="reset-button">重置</el-button>
        </div>
      </el-card>

      <!-- 图表区域 -->
      <el-row :gutter="16" class="charts-container">
        <!-- 服务资源利用图表 -->
        <el-col :xs="24" :lg="12" class="chart-wrapper">
          <el-card class="chart-card">
            <div slot="header" class="card-header">
              <span class="card-title">服务资源利用分布</span>
              <div class="card-actions">
                <el-radio-group v-model="resourceTimeRange" size="small">
                  <el-radio-button label="day">日</el-radio-button>
                  <el-radio-button label="week">周</el-radio-button>
                  <el-radio-button label="month" checked>月</el-radio-button>
                </el-radio-group>
              </div>
            </div>
            <div class="chart-content">
              <div ref="resourceUtilChart" class="chart"></div>
            </div>
          </el-card>
        </el-col>

        <!-- 订单趋势统计图表 -->
        <el-col :xs="24" :lg="12" class="chart-wrapper">
          <el-card class="chart-card">
            <div slot="header" class="card-header">
              <span class="card-title">订单趋势统计</span>
              <div class="card-actions">
                <el-radio-group v-model="orderTimeRange" size="small">
                  <el-radio-button label="month">月</el-radio-button>
                  <el-radio-button label="quarter">季度</el-radio-button>
                  <el-radio-button label="year" checked>年</el-radio-button>
                </el-radio-group>
              </div>
            </div>
            <div class="chart-content">
              <div ref="orderTrendChart" class="chart"></div>
            </div>
          </el-card>
        </el-col>
      </el-row>

      <!-- 服务资源列表已移除 -->
    </el-main>
  </div>
</template>

<script>
import * as echarts from 'echarts';
import moment from 'moment';

export default {
  name: 'AnalyzePage',
  data() {
    return {
      activeTab: 'resourceAnalysis',
      searchName: '',
      selectedCrop: 'all',
      selectedType: 'all',
      selectedRegion: 'all',
      dateRange: [],
      totalResources: 245,
      monthlyOrders: 1856,
      serviceRevenue: 568200,
      activeUsers: 325,
      resourceTimeRange: 'month',
      orderTimeRange: 'year',
      currentDate: '',
      // 图表实例
      resourceUtilChart: null,
      orderTrendChart: null
    };
  },
  mounted() {
    this.setCurrentDate();
    this.initResourceUtilChart();
    this.initOrderTrendChart();
    
    // 监听窗口大小变化，重新调整图表大小
    window.addEventListener('resize', this.handleResize);
  },
  beforeDestroy() {
    // 组件销毁前，移除事件监听并释放图表资源
    window.removeEventListener('resize', this.handleResize);
    if (this.resourceUtilChart) {
      this.resourceUtilChart.dispose();
    }
    if (this.orderTrendChart) {
      this.orderTrendChart.dispose();
    }
  },
  methods: {
    // 设置当前日期
    setCurrentDate() {
      this.currentDate = moment().format('YYYY年MM月DD日');
    },
    
    // 初始化服务资源利用图表
    initResourceUtilChart() {
      const chart = echarts.init(this.$refs.resourceUtilChart);
      this.resourceUtilChart = chart;
      
      const option = {
        backgroundColor: 'transparent',
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'shadow',
            shadowStyle: {
              color: 'rgba(0, 187, 236, 0.1)'
            }
          },
          backgroundColor: 'rgba(12, 30, 62, 0.8)',
          borderColor: '#1e4d85',
          textStyle: {
            color: '#fff'
          },
          formatter: '{b}: {c} 次'
        },
        grid: {
          left: '3%',
          right: '4%',
          bottom: '15%',
          top: '10%',
          containLabel: true
        },
        xAxis: {
          type: 'category',
          data: ['耕种', '施肥', '病虫害', '收割', '运输', '交易', '仓储', '烘干'],
          axisLabel: {
            color: '#8aa4ce',
            fontSize: 12,
            interval: 0,
            rotate: 0
          },
          axisLine: {
            lineStyle: {
              color: '#1e4d85'
            }
          },
          axisTick: {
            alignWithLabel: true,
            lineStyle: {
              color: '#1e4d85'
            }
          }
        },
        yAxis: {
          type: 'value',
          axisLabel: {
            color: '#8aa4ce',
            fontSize: 12,
            formatter: '{value}'
          },
          axisLine: {
            lineStyle: {
              color: '#1e4d85'
            }
          },
          splitLine: {
            lineStyle: {
              color: 'rgba(30, 77, 133, 0.3)',
              type: 'dashed'
            }
          }
        },
        series: [
          {
            name: '服务资源',
            type: 'bar',
            barWidth: '50%',
            data: [58400, 51350, 48390, 46500, 53000, 33080, 28590, 19940],
            animationDelay: function (idx) {
              return idx * 100;
            },
            itemStyle: {
              // 使用渐变色填充柱形
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                { offset: 0, color: '#00bfff' },
                { offset: 1, color: '#0c5adb' }
              ]),
              // 添加圆角
              borderRadius: [4, 4, 0, 0],
              // 添加发光效果
              shadowBlur: 10,
              shadowColor: 'rgba(0, 191, 255, 0.5)',
              shadowOffsetY: 5
            },
            emphasis: {
              itemStyle: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                  { offset: 0, color: '#5ac8fa' },
                  { offset: 1, color: '#1976d2' }
                ]),
                shadowBlur: 20,
                shadowColor: 'rgba(0, 191, 255, 0.8)'
              }
            }
          }
        ],
        animationEasing: 'elasticOut',
        animationDelayUpdate: function (idx) {
          return idx * 5;
        }
      };
      
      chart.setOption(option);
    },
    
    // 初始化订单趋势统计图表
    initOrderTrendChart() {
      const chart = echarts.init(this.$refs.orderTrendChart);
      this.orderTrendChart = chart;
      
      const option = {
        backgroundColor: 'transparent',
        tooltip: {
          trigger: 'axis',
          backgroundColor: 'rgba(12, 30, 62, 0.8)',
          borderColor: '#1e4d85',
          textStyle: {
            color: '#fff'
          },
          formatter: function(params) {
            let result = params[0].name + '<br/>';
            params.forEach(param => {
              result += `${param.marker}${param.seriesName}: ${param.value.toLocaleString()} 单<br/>`;
            });
            return result;
          }
        },
        legend: {
          data: ['包地', '油作物'],
          textStyle: {
            color: '#8aa4ce',
            fontSize: 12
          },
          top: '10%',
          right: '5%',
          itemWidth: 10,
          itemHeight: 10
        },
        grid: {
          left: '3%',
          right: '4%',
          bottom: '15%',
          top: '20%',
          containLabel: true
        },
        xAxis: {
          type: 'category',
          boundaryGap: false,
          data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
          axisLabel: {
            color: '#8aa4ce',
            fontSize: 12
          },
          axisLine: {
            lineStyle: {
              color: '#1e4d85'
            }
          },
          splitLine: {
            show: false
          }
        },
        yAxis: {
          type: 'value',
          axisLabel: {
            color: '#8aa4ce',
            fontSize: 12,
            formatter: '{value}'
          },
          axisLine: {
            lineStyle: {
              color: '#1e4d85'
            }
          },
          splitLine: {
            lineStyle: {
              color: 'rgba(30, 77, 133, 0.3)',
              type: 'dashed'
            }
          }
        },
        series: [
          {
            name: '包地',
            type: 'line',
            stack: '总量',
            smooth: true,
            symbol: 'circle',
            symbolSize: 6,
            sampling: 'average',
            itemStyle: {
              color: '#ffd700'
            },
            lineStyle: {
              width: 3,
              color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
                { offset: 0, color: '#ffd700' },
                { offset: 1, color: '#ff9800' }
              ])
            },
            areaStyle: {
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                { offset: 0, color: 'rgba(255, 215, 0, 0.5)' },
                { offset: 1, color: 'rgba(255, 215, 0, 0.1)' }
              ])
            },
            emphasis: {
              focus: 'series',
              itemStyle: {
                shadowBlur: 10,
                shadowColor: 'rgba(255, 215, 0, 0.5)',
                symbolSize: 8
              }
            },
            data: [5000, 8000, 15000, 12000, 16000, 20000, 22000, 18000, 25000, 23000, 18000, 15000]
          },
          {
            name: '油作物',
            type: 'line',
            stack: '总量',
            smooth: true,
            symbol: 'circle',
            symbolSize: 6,
            sampling: 'average',
            itemStyle: {
              color: '#00bfff'
            },
            lineStyle: {
              width: 3,
              color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
                { offset: 0, color: '#00bfff' },
                { offset: 1, color: '#0066cc' }
              ])
            },
            areaStyle: {
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                { offset: 0, color: 'rgba(0, 191, 255, 0.5)' },
                { offset: 1, color: 'rgba(0, 191, 255, 0.1)' }
              ])
            },
            emphasis: {
              focus: 'series',
              itemStyle: {
                shadowBlur: 10,
                shadowColor: 'rgba(0, 191, 255, 0.5)',
                symbolSize: 8
              }
            },
            data: [4000, 6000, 10000, 8000, 12000, 14000, 16000, 14000, 18000, 16000, 12000, 10000]
          }
        ],
        animationDuration: 1500
      };
      
      chart.setOption(option);
    },
    

    
    // 处理窗口大小变化
    handleResize() {
      if (this.resourceUtilChart) {
        this.resourceUtilChart.resize();
      }
      if (this.orderTrendChart) {
        this.orderTrendChart.resize();
      }
    }
  },
  watch: {
    // 监听时间范围变化，重新加载图表数据
    resourceTimeRange() {
      this.initResourceUtilChart();
    },
    orderTimeRange() {
      this.initOrderTrendChart();
    }
  }
};
</script>

<style scoped>
/* 全局样式重置 */
* {
  box-sizing: border-box;
}

/* 主容器样式 */
.main-content {
  height: 100vh;
  background: 
    linear-gradient(135deg, #0c1e3e 0%, #0a1a33 50%, #081428 100%),
    radial-gradient(circle at 20% 80%, rgba(90, 200, 250, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(0, 187, 236, 0.1) 0%, transparent 50%);
  color: #fff;
  overflow: hidden;
  position: relative;
}

.main-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%2300bbec' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* 头部样式 */
.header-container {
  height: 80px;
  background: rgba(12, 30, 62, 0.95);
  border-bottom: 1px solid rgba(90, 200, 250, 0.3);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(90, 200, 250, 0.1);
  position: relative;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-content {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: relative;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.logo::after {
  content: '';
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 30px;
  background: linear-gradient(180deg, transparent, rgba(90, 200, 250, 0.5), transparent);
}

.logo-icon {
  font-size: 32px;
  background: linear-gradient(135deg, #00bfff 0%, #5ac8fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 4px rgba(0, 191, 255, 0.3));
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, #5ac8fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 8px rgba(0, 191, 255, 0.2);
}

.header-tabs {
  flex: 1;
  margin: 0 60px;
  display: flex;
  height: 44px;
  line-height: 44px;
  /* align-items: center;
  justify-content: center; */
}

.header-tabs .el-tabs {
  flex: 1;
  max-width: 500px;
}

.header-tabs .el-tabs__nav {
  background: transparent;
  border: none;
}

.header-tabs .el-tabs__item {
  color: #8aa4ce;
  font-size: 15px;
  font-weight: 500;
  padding: 0 24px;
  height: 44px;
  line-height: 44px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 8px 8px 0 0;
  position: relative;
  overflow: hidden;
}

.header-tabs .el-tabs__item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(90, 200, 250, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.header-tabs .el-tabs__item:hover {
  color: #5ac8fa;
  background: rgba(90, 200, 250, 0.05);
}

.header-tabs .el-tabs__item:hover::before {
  opacity: 1;
}

.header-tabs .el-tabs__item.is-active {
  color: #00bfff;
  background: rgba(0, 187, 236, 0.1);
  font-weight: 600;
}

.header-tabs .el-tabs__item.is-active::before {
  opacity: 1;
}

.header-tabs .el-tabs__active-bar {
  background: linear-gradient(90deg, #00bfff 0%, #5ac8fa 100%);
  height: 3px;
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0, 191, 255, 0.4);
}

.header-tabs .el-tabs__item .el-icon {
  margin-right: 6px;
  font-size: 16px;
}

/* 主内容区域 */
.main-container {
  height: calc(100vh - 80px);
  padding: 24px;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

/* 统计卡片 */
.stats-cards {
  margin-bottom: 24px;
}

.stat-card-wrapper {
  animation: fadeInUp 0.6s ease-out;
}

.stat-card-wrapper:nth-child(2) {
  animation-delay: 0.1s;
}

.stat-card-wrapper:nth-child(3) {
  animation-delay: 0.2s;
}

.stat-card-wrapper:nth-child(4) {
  animation-delay: 0.3s;
}

.stat-card {
  height: 140px;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(90, 200, 250, 0.2);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #00bfff, #5ac8fa);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(90, 200, 250, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-8px);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(90, 200, 250, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.stat-card:hover::after {
  opacity: 1;
}

.stat-card-primary {
  background: linear-gradient(135deg, rgba(0, 135, 255, 0.15) 0%, rgba(0, 68, 136, 0.15) 100%);
}

.stat-card-success {
  background: linear-gradient(135deg, rgba(34, 193, 195, 0.15) 0%, rgba(25, 135, 84, 0.15) 100%);
}

.stat-card-warning {
  background: linear-gradient(135deg, rgba(253, 203, 110, 0.15) 0%, rgba(255, 159, 64, 0.15) 100%);
}

.stat-card-info {
  background: linear-gradient(135deg, rgba(102, 16, 242, 0.15) 0%, rgba(66, 133, 244, 0.15) 100%);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  position: relative;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stat-card-primary .stat-icon {
  background: linear-gradient(135deg, #00bfff 0%, #0066cc 100%);
}

.stat-card-success .stat-icon {
  background: linear-gradient(135deg, #34c759 0%, #28a745 100%);
}

.stat-card-warning .stat-icon {
  background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
}

.stat-card-info .stat-icon {
  background: linear-gradient(135deg, #8b5cf6 0%, #6c757d 100%);
}

.stat-content {
  flex: 1;
  position: relative;
  z-index: 2;
}

.stat-title {
  color: #8aa4ce;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #fff 0%, #5ac8fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-change {
  font-size: 12px;
  color: #34c759;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.stat-change .el-icon-arrow-up {
  font-size: 10px;
}

/* 搜索和筛选卡片 */
.search-filter-card {
  background: rgba(24, 55, 101, 0.7);
  border: 1px solid rgba(90, 200, 250, 0.3);
  border-radius: 16px;
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease-out 0.4s both;
  backdrop-filter: blur(10px);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.search-filter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(90, 200, 250, 0.5), transparent);
}

.search-filter {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 24px;
}

/* 输入框和选择框样式 */
.search-input,
.filter-select,
.date-range-picker {
  position: relative;
}

.search-input .el-input__inner,
.filter-select .el-input__inner,
.date-range-picker .el-input__inner {
  background: rgba(12, 30, 62, 0.9);
  border: 1px solid rgba(90, 200, 250, 0.3);
  color: #fff;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  height: 44px;
  line-height: 44px;
}

.search-input .el-input__inner:hover,
.filter-select .el-input__inner:hover,
.date-range-picker .el-input__inner:hover {
  border-color: #5ac8fa;
  box-shadow: 
    0 4px 12px rgba(90, 200, 250, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.search-input .el-input__inner:focus,
.filter-select .el-input__inner:focus,
.date-range-picker .el-input__inner:focus {
  border-color: #00bfff;
  box-shadow: 
    0 0 0 3px rgba(0, 187, 236, 0.2),
    0 4px 12px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.search-input .el-input__inner::placeholder,
.filter-select .el-input__inner::placeholder {
  color: #8aa4ce;
}

.search-input {
  width: 280px;
}

.filter-select {
  width: 160px;
}

.date-range-picker {
  width: 260px;
}

/* 按钮样式 */
.search-button,
.reset-button {
  height: 44px;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.search-button {
  background: linear-gradient(135deg, #00bfff 0%, #5ac8fa 100%);
  border: none;
  color: #fff;
  padding: 0 24px;
  box-shadow: 
    0 4px 15px rgba(0, 187, 236, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-button:hover {
  background: linear-gradient(135deg, #0099cc 0%, #4ab5e3 100%);
  transform: translateY(-2px);
  box-shadow: 
    0 8px 25px rgba(0, 187, 236, 0.4),
    0 4px 8px rgba(0, 0, 0, 0.15);
  color: #fff;
}

.reset-button {
  background: rgba(12, 30, 62, 0.9);
  border: 1px solid rgba(90, 200, 250, 0.3);
  color: #8aa4ce;
  padding: 0 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.reset-button:hover {
  background: rgba(12, 30, 62, 1);
  border-color: #5ac8fa;
  color: #5ac8fa;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 图表容器 */
.charts-container {
  margin-bottom: 24px;
}

.chart-wrapper {
  animation: fadeInUp 0.6s ease-out 0.5s both;
}

.chart-wrapper:nth-child(2) {
  animation-delay: 0.6s;
}

.chart-card {
  background: rgba(24, 55, 101, 0.7);
  border: 1px solid rgba(90, 200, 250, 0.3);
  border-radius: 16px;
  height: 450px;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
}

.chart-card:hover {
  border-color: rgba(90, 200, 250, 0.5);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(90, 200, 250, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: rgba(12, 30, 62, 0.9);
  border-bottom: 1px solid rgba(90, 200, 250, 0.3);
  border-radius: 16px 16px 0 0;
  position: relative;
}

.card-header::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(90, 200, 250, 0.5), transparent);
}

.card-title {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(135deg, #fff 0%, #5ac8fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-actions .el-radio-button__inner {
  background: rgba(12, 30, 62, 0.9);
  border: 1px solid rgba(90, 200, 250, 0.3);
  color: #8aa4ce;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 12px;
  padding: 6px 12px;
}

.card-actions .el-radio-button__inner:hover {
  border-color: #5ac8fa;
  color: #5ac8fa;
}

.card-actions .el-radio-button.is-active .el-radio-button__inner {
  background: linear-gradient(135deg, #00bfff 0%, #5ac8fa 100%);
  border-color: #5ac8fa;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 187, 236, 0.3);
}

.chart-content {
  flex: 1;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart {
  width: 100%;
  height: 320px;
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* 美化滚动条 */
.main-container::-webkit-scrollbar {
  width: 8px;
}

.main-container::-webkit-scrollbar-track {
  background: rgba(12, 30, 62, 0.5);
  border-radius: 4px;
}

.main-container::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #00bfff 0%, #5ac8fa 100%);
  border-radius: 4px;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.main-container::-webkit-scrollbar-thumb:hover {
  opacity: 0.8;
}

/* 响应式设计 */
@media screen and (max-width: 1200px) {
  .header-tabs {
    margin: 0 30px;
  }
  
  .search-input {
    width: 240px;
  }
  
  .filter-select {
    width: 140px;
  }
  
  .date-range-picker {
    width: 220px;
  }
}

@media screen and (max-width: 992px) {
  .header-content {
    padding: 0 20px;
  }
  
  .header-tabs {
    display: none;
  }
  
  .search-filter {
    gap: 12px;
  }
  
  .search-input,
  .filter-select,
  .date-range-picker {
    flex: 1;
    min-width: 150px;
  }
  
  .stat-card {
    height: 120px;
    padding: 20px;
  }
  
  .stat-icon {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
  
  .stat-value {
    font-size: 24px;
  }
}

@media screen and (max-width: 768px) {
  .main-container {
    padding: 16px;
  }
  
  .header-content {
    padding: 0 16px;
  }
  
  .logo-text {
    font-size: 18px;
  }
  
  .stats-cards .el-col {
    margin-bottom: 16px;
  }
  
  .search-filter {
    flex-direction: column;
    gap: 12px;
  }
  
  .search-input,
  .filter-select,
  .date-range-picker,
  .search-button,
  .reset-button {
    width: 100%;
  }
  
  .chart-wrapper {
    margin-bottom: 16px;
  }
  
  .chart-card {
    height: 350px;
  }
}

/* 加载动画 */
.loading-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
}

/* 图标美化 */
.el-icon {
  transition: all 0.3s ease;
}

.el-icon-search,
.el-icon-refresh {
  font-size: 16px;
}

/* 特殊效果 */
.glow-effect {
  filter: drop-shadow(0 0 8px rgba(0, 187, 236, 0.4));
}

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}
</style>